// components/my/myid.js
import urls from '../../utils/urls.js'
import loginFn from '../../utils/login.js'
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    mineInfo: {
      type: null,
      value: []
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    list: [{
        img: '/img/myinfo.png',
        text1: '我的资料',
        id: 0,
        imgs: '/img/mored.png',
        path: '/pages/myinfo/index'
      },
      {
        img: '/img/myschool.png',
        text1: '我的学校',
        id: 1,
        // text2:'8家',
        imgs: '/img/mored.png',
        path: '/pages/myin/myin'

        // path:'/pages/searchschool/index?schoolTypeId={{navList[index].schoolTypeId}}'
      },
      // {
      //   img:'/img/mycourse.png',
      //   text1:'我的课程',
      //   id:2,
      //   imgs:'/img/mored.png',
      //   // text2:'9门'
      // },

      {
        img: '/img/appoint.png',
        text1: '预约管理',
        id: 3,
        imgs: '/img/mored.png',
        path: '/pages/appointment/index?type=teacher'
      },
      {
        img: '/img/appoint.png',
        text1: '想学',
        id: 4,
        imgs: '/img/mored.png',
        path: '/pages/wantStudy/index'
      },
      {
        img: '/img/erweima.png',
        text1: '下载我的老师二维码',
        imgs: '/img/mored.png',
        id: 5,
        path: '/pages/mycode/mycode?type=teacher'
      },
      {
        img: '/img/recall.png',
        text1: '反馈建议',
        imgs: '/img/mored.png',
        id: 6
      },
      // {
      //   img: '/img/business.png',
      //   text1: '商务合作',
      //   imgs: '/img/mored.png',
      //   id: 7
      // },
      // {
      //   img: '/img/daili.png',
      //   text1: '成为要培训的城市代理',
      //   id: 8,
      //   imgs: '/img/mored.png',
      //   text2: '共享发展红利'
      // },
    ],
    text2: '',
  },
  /**
   * 组件的方法列表
   */
  methods: {
    infoDetail: function(e) {
      let path = e.currentTarget.dataset.path;
      let id = e.currentTarget.dataset.id;
      if (id == 0) {
        path = '/pages/addteacher/index?teacherId=' + this.data.mineInfo.teacherId
      } else if(id == 4) {
        path = '/pages/wantStudy/index?id=' + this.data.mineInfo.teacherId+'&type=teacher'
      }
      wx.navigateTo({
        url: path
      })
    },
  }
})